{% comment %}
    Date:       2023-02-07
    Purpose:    Shortcode that will delete metrics data based on the key that was used to create a set. "Irv... Cleanup on table [dbo].[_com_trinityfellowship_MetricsTemp] !"
    Created by: Trinity Fellowship Church, 5000 Hollywood Rd. Amarillo, TX 79118 
{% endcomment %}
{% if thekey != 'No' %}
    {% sql %}
        DECLARE @lavakey AS NVARCHAR(240) = '{{ thekey1 }}' + '%';
        Delete FROM [dbo].[_com_trinityfellowship_MetricsTemp] OUTPUT DELETED.ID WHERE [TheKey] LIKE @lavakey;
    {% endsql %}
{% endif %}